<?php
  include("include/conn.php");
  require('include/Smarty/libs/Smarty.class.php');
  
  $kaarigarIdCount = "";
  $kaarigarId      = "";
  $kaarigarName    = "";
  $msg = "";
  $i = 0;
  $selectQueryKaarigarName = "SELECT kaarigarid,kaarigarname 
                                FROM kaarigar
                               ORDER BY kaarigarname DESC";
  $selectQueryKaarigarNameResult = mysql_query($selectQueryKaarigarName);
  $kaarigarNameRow = mysql_num_rows($selectQueryKaarigarNameResult);
  if($kaarigarNameRow > 0)
  {
    while($kaarigarNameRow = mysql_fetch_array($selectQueryKaarigarNameResult))
    {
      $kaarigarIdCount  .= $kaarigarNameRow['kaarigarid'].",";
      $kaarigarId[$i]    = $kaarigarNameRow['kaarigarid'];
      $kaarigarName[$i]  = $kaarigarNameRow['kaarigarname'];
      $i++;
    }
  }
  else
  {
    $msg = "<center><div class='clean-gray'>Kaarigar Not Found ...!!!</div></center>";
  }
  $smarty = new Smarty;
  require('bottom.php');
  $smarty->assign("l_listKaarigar",$l_listKaarigar);
  $smarty->assign("l_kaarigarName",$l_kaarigarName);

  $smarty->assign("i",$i);
  $smarty->assign("msg",$msg);
  $smarty->assign("kaarigarIdCount",$kaarigarIdCount);
  $smarty->assign("kaarigarId",$kaarigarId);
  $smarty->assign("kaarigarName",$kaarigarName);
  $smarty->display('kaarigarList.tpl');
?>
